<html  xmlns:th="http://www.thymeleaf.org">
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <title>个人信息页面</title>

    <!-- 引入 jQuery Mobile 样式 -->
    <link rel="stylesheet" href="http://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.css">

    <!-- 引入 jQuery 库 -->
    <script src="http://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>

    <!-- 引入 jQuery Mobile 库 -->
    <script src="http://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>





    <style type="text/css">
        body {
            font-family:微软雅黑,arial;
            font-size:16px;
            padding:0px;
            margin:0 auto;
        }

        .font-blue{
            color:#4E90C7!important;
        }

        .input-lightblue{
            background-color: #E5F2FD!important;
        }

        .font-label{
            color: black!important;
            font-size: 19px!important;
        }

        /* 验证错误提示信息*/
        form label.error{color: Red;padding:0px;margin:0px;line-height:0px;white-space: nowrap;}
    </style>
    <script type="text/javascript">
        function close(){
            WeixinJSBridge.call('closeWindow');
        }

        function updateUser(){

            //非空校验
            var name=$("#name").val();
            if(name==""){
                alert("姓名不能为空");
                return ;
            }
            //{"name":"lisi","":"","":""}
            var dataObj=$("#form").serialize();
            $.ajax({
                type:"post",
                url:"/user/update",
                data:dataObj,
                success:function(msg){
                    if(msg.code=="2000"){
                        alert("用户更新成功");
                    }else{
                        alert("因网络异常，稍候重试");
                    }

                }
            })

        }

    </script>
</head>
<body>
<div data-role="page" id="pageMain">
    <div data-role="header" data-theme="c" style="background-color: #4E90C7;" data-position="fixed">
        <a href="javascript:close()" >返回</a>
        <h1>个人信息</h1>
    </div>
    <div style="padding-top:20px;padding-bottom: 20px">
        <form id="form"  method="post">
            <input type="hidden" id="id" name="id" th:value="${user.id}" />
            <!-- <div>基本信息</div> -->
            <div>
                <div style="padding-right:20px;padding-left:20px">
                    <label for="name"  class="font-label">姓名(<font color="red">必填</font>)</label>
                    <input type="text" name="name" id="name" th:value="${user.name}"  placeholder="请输入您的真实姓名" class="required font-blue input-lightblue">
                </div>

                <div class="ui-grid-a" style="padding-right:20px;padding-left:20px">
                    <div class="ui-block-a" style="padding-right:10px">
                        <label for="province"  class="font-label">省份</label>
                        <input type="text" name="province" id="province" th:value="${user.province}"  placeholder="请输入您所在省份" class="font-blue input-lightblue">
                    </div>
                    <div class="ui-block-b" style="padding-left:10px">
                        <label for="city"  class="font-label">城市</label>
                        <input type="text" name="city" id="city"  placeholder="请输入您所在城市" th:value="${user.city}" class="font-blue input-lightblue">
                    </div>
                </div>


                <div style="padding-right:20px;padding-left:20px">
                    <label for="telphone"  class="font-label">手机号(<font color="red">必填</font>)</label>
                    <input type="text" name="telphone" id="telphone"  th:value="${user.telphone}" placeholder="请输入您的手机号" class="required isPhone font-blue input-lightblue" >

                    <label for="email"  class="font-label">邮箱(此项不可更改)</label>
                    <input type="text" id="email" th:value="${user.email}"  class="font-blue input-lightblue" readonly="readonly">
                </div>


                <div class="ui-grid-a" style="padding-right:20px;padding-left:20px">
                    <div class="ui-block-a" style="padding-right:10px">
                        <label for="zone"  class="font-label">区域(此项不可更改)</label>
                        <input type="text" id="zone" th:value="${user.zone}"  readonly="readonly" class="font-blue input-lightblue">
                    </div>
                    <div class="ui-block-b" style="padding-left:10px">
                        <label for="rid"  class="font-label">权限(此项不可更改)</label>

                        <span th:if="${user.rid==1}">
                              <input type="text" id="rid"  value="发单组" class="font-blue input-lightblue" readonly="readonly">
                        </span>
                        <span th:if="${user.rid==2}">
                              <input type="text" id="rid"   value="抢单组" class="font-blue input-lightblue" readonly="readonly">
                        </span>

                    </div>
                </div>


            </div>

            <div style="padding-right:20px;padding-left:20px;padding-top:20px;">
                <input id="updateBtn" type="button" value="更新" onclick="updateUser()"  style="padding:10px;background: #e57330;text-shadow: none;opacity:100;color:white;font-size:20px;text-indent:0px;font-family:微软雅黑;" >
            </div>
        </form>
    </div>
</div>
</body>
</html>
